using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace Slqj.Data
{
	public static class TableAttractionType
	{
		public const string Table = "AttractionType";
		public const string AttractionTypeID = "AttractionTypeID";
		public const string AttractionTypeName = "AttractionTypeName";
		public const string Description = "Description";
	}
	
	[Serializable]
	public class BaseAttractionType
		: IDbSessionEntity, IJsonClass
	{
		int m_AttractionTypeID;
		/// <summary>
        /// 景点类型表ID
        /// </summary>
        public int AttractionTypeID
        {
            get { return m_AttractionTypeID; }
            set { m_AttractionTypeID = value; }
        }
		
		string m_AttractionTypeName;
		/// <summary>
        /// 景点类型名称
        /// </summary>
        public string AttractionTypeName
        {
            get { return m_AttractionTypeName; }
            set { m_AttractionTypeName = value; }
        }
		
		string m_Description;
		/// <summary>
        /// 景点类型描述
        /// </summary>
        public string Description
        {
            get { return m_Description; }
            set { m_Description = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_AttractionTypeID = reader[TableAttractionType.AttractionTypeID];
            m_AttractionTypeName = reader[TableAttractionType.AttractionTypeName];
            m_Description = reader[TableAttractionType.Description];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableAttractionType.AttractionTypeID, PrimaryKeyType.Identity, AttractionTypeID);
			writer[TableAttractionType.AttractionTypeName] = AttractionTypeName;
			writer[TableAttractionType.Description] = Description;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_AttractionTypeID = idd;
        }
		
		public string TableName
        {
            get { return TableAttractionType.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_AttractionTypeID = hashToRead["AttractionTypeID"];
			 
             m_AttractionTypeName = hashToRead["AttractionTypeName"];
			 
             m_Description = hashToRead["Description"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["AttractionTypeID"] = AttractionTypeID;
			 
            hashToFill["AttractionTypeName"] = AttractionTypeName;
			 
            hashToFill["Description"] = Description;
			 
        }

        #endregion
		
	}
}
